<include file="public:header" />
<script type="text/javascript" src="__ROOT__/statics/js/jquery/plugins/jquery.imagePreview.js"></script>
<div class="pad-lr-10">
	 <form name="searchform" action="" method="get" >
    <table width="100%" cellspacing="0" class="search-form">
        <tbody>
            <tr>
            <td>
            <div class="explain-col">				
                &nbsp;订单号/商品名称 :
                <input name="keyword" type="text" class="input-text" size="25" value="{$keyword}" />
                <input type="hidden" name="m" value="exchange_order" />
                <input type="submit" name="search" class="button" value="搜索" />
        	</div>
            </td>
            </tr>
        </tbody>
    </table>
    </form>	
    <form id="myform" name="myform" action="{:u('exchange_order/delete')}" method="post" onsubmit="return check();">
    <div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th width=50>ID</th>
                <th width=30><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>				
				<th width=100>{:L('sn')}</th>
                <th width=400>{:L('data_name')}</th>	
				<th width=60>{:L('data_num')}</th>
                <th width=120>{:L('integral')}</th>
				<th width=120>{:L('user_name')}</th>
				<th width=120>{:L('create_time')}</th> 
				<th width=120>{:L('goods_status')}</th>				
                <th width=120>操作</th>
            </tr>
        </thead>
    	<tbody>
        <volist name="ex_order_list" id="val" key='k' >
	        <tr>
	        	<td align="center">{$val.id}</td>     
	            <td align="center"><input type="checkbox" value="{$val.id}" name="id[]" </td>				     
	            <td align="left">{$val.sn}</td>          
	            <td align="center">{$val.data_name}</td> 		
				<td align="center">{$val.data_num}</td>
				<td align="center">{$val.order_score}</td>
				<td align="center">{$val.user_name}</td>
				<td align="center">{$val.create_time|date="Y-m-d",###}</td>	
				<td align="center">					
					<if condition="$val.goods_status eq '0' ">
						未发货					
					</if>
					<if condition="$val.goods_status eq '1' ">
						已发货					
					</if>					
															
				</td>
	            <td align="center"><a href="{:u('exchange_order/edit',array('id'=>$val['id']))}">编辑</a></td>
	        </tr>
        </volist>
    	</tbody>
    </table>
    <div class="btn">
		<label for="check_box" style="float:left;">{$Think.lang.select_all}/{$Think.lang.cancel}</label>
		<input type="submit" class="button" name="dosubmit" value="{$Think.lang.delete}" onclick="return confirm('{$Think.lang.sure_delete}')" style="float:left;margin-left:10px;"/>
		<div id="pages">{$page}</div>
    </div>
    </div>
    </form>
</div>
<script language="javascript">
$(function(){
	$(".preview").preview();
});

function check(){
	var ids='';
	$("input[name='id[]']:checked").each(function(i, n){
		ids += $(n).val() + ',';
	});
	if(ids=='') {
		window.top.art.dialog({content:lang_please_select+'菜单分类名称	',lock:true,width:'200',height:'50',time:1.5},function(){});
		return false;
	}
	return true;
}
function edit(id, name) {
	var lang_edit = "{$Think.lang.edit}";
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({
		title:lang_edit+'--'+name,
		id:'edit',
		iframe:'?m=exchange_order&a=edit&id='+id,width:'480',height:'170'
		}, 
		function()
		{
			var d = window.top.art.dialog({id:'edit'}).data.iframe;
			d.document.getElementById('dosubmit').click();
			return false;
		}, 
		function()
		{
			window.top.art.dialog({id:'edit'}).close()
		});
}
function status(id,type){
    $.get("{:u('exchange_order/status')}", { id: id, type: type }, function(jsondata){
		var return_data  = eval("("+jsondata+")");
		$("#"+type+"_"+id+" img").attr('src', '__ROOT__/statics/images/status_'+return_data.data+'.gif');
	}); 
}
//排序方法
function sort(id,type,num){
    $.get("{:u('exchange_order/sort')}", { id: id, type: type,num:num }, function(jsondata){
		var return_data  = eval("("+jsondata+")");
		$("#"+type+"_"+id+" ").attr('value', return_data.data);
	}); 
}
</script>
</body>
</html>